<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<form id="pagerForm" method="get" model="viewRequest" action="#rel#">
	<input type="hidden" name="viewRequest.page" value="${page.number}" />
	<input type="hidden" name="viewRequest.size" value="${page.size}" />
	<c:forEach items="${viewRequest.params}" var="params">
		<input type="hidden" id="${params.key}" name="viewRequest.params['${params.key}']" value="${params.value}" />
	</c:forEach>
	<c:forEach items="${viewRequest.sort}" var="sort">
		<input type="hidden" name="viewRequest.sort.${sort.key}" value="${sort.value}" />
	</c:forEach>
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return reviews_navSearch(this);" action="${rootUrl}/goods/goods-reviews" method="get">
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label>商品名称：</label>
				<input type="hidden" id="reviewsIndexGoodsId" name="goods.id" value="${viewRequest.params['_and_v_dot_goodsId_eq_number'] }"/>
				<input type="text" id="reviewsIndexGoodsName" name="goods.name" style="float:left" value="${ goodsName}"/>
				<a class="btnLook" rel="goodsRS_main" href="${rootUrl}/goods/goods/1/dialog" width="1300" height="720" lookupGroup="goods">商品名称</a>
			</li>
			<li>
				<label>商家：</label>
				<input type="hidden" id="sellerId" name="seller.id" value="${viewRequest.params._and_g_dot_seller_dot_id_eq_string}"/>
				<input type="text" style="float:left" id="sellerName" name="seller.name" value="${sellerName}"/>
				<a class="btnLook" href="${rootUrl}/seller/seller/1/dialog" width="800" height="720" lookupGroup="seller">商家</a>
			</li>
			<li>
				<label>审核状态：</label>
				<select  name="viewRequest.params['_and_v_dot_state_eq_string']">
				<option <c:if test="${viewRequest.params['_and_v_dot_state_eq_string'] == ''}">selected="selected"</c:if> value="">全部</option>
				<option <c:if test="${viewRequest.params['_and_v_dot_state_eq_string'] == '0'}">selected="selected"</c:if> value="0">等待审核</option>
				<option <c:if test="${viewRequest.params['_and_v_dot_state_eq_string'] == '1'}">selected="selected"</c:if> value="1">通过</option>
				<option <c:if test="${viewRequest.params['_and_v_dot_state_eq_string'] == '-1'}">selected="selected"</c:if> value="-1">审核失败</option>
				</select>
			</li>
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
		</ul>
	</div>
	<table class="table" targetType="navTab"  width="100%" layoutH="135">
		<thead>
			<tr>
				<th width="30" align="center" >序号</th>
				<th width="120">商品名称</th>
				<th width="50">审批结果</th>
				<th width="200">批语</th>
				<th width="120">审批人</th>
				<th width="120">添加审批时间</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.content}" var="goodsReviews" varStatus="status">
			<tr target="data_id">
				<td>${status.count}</td>
				<td>${goodsReviews[0] }</td>
				<td>
					<c:if test="${goodsReviews[1] == '0'}">等待审核</c:if>
					<c:if test="${goodsReviews[1] == '1'}">通过</c:if>
					<c:if test="${goodsReviews[1] == '-1'}">未通过</c:if>
				</td>
				<td>${goodsReviews[2] }</td>
				<td>${goodsReviews[3] }</td>
				<td><fmt:formatDate value="${goodsReviews[4] }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>
					<a title="审批" target="navTab" class="btnView" rel="goods_reviews_detail" href="${rootUrl}/goods/goods-reviews/${goodsReviews[5]}/edit"></a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="${page.size}">${page.size}</option>
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共${page.totalElements}条 </span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${page.totalElements}" numPerPage="${page.size}" pageNumShown="10" currentPage="${page.number}"></div>
	</div>
</div>

<script>
	function reviews_navSearch(obj){
		$("#reviewsIndexGoodsId").attr("name","viewRequest.params['_and_v_dot_goodsId_eq_number']");
		$("#reviewsIndexGoodsName").attr("name","goodsName");
		
		return navTabSearch(obj);
	}
</script>